<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
  <title>福利清单.xlsx</title>
  <link href="http://img.alicdn.com/tfs/TB1XlF3RpXXXXc6XXXXXXXXXXXX-16-16.png" rel="shortcut icon"
        type="image/x-icon"/>
  <link rel="stylesheet" href="https://cdn.staticfile.org/Swiper/3.2.6/css/swiper.min.css">
  <script src="https://cdn.staticfile.org/vue/2.6.10/vue.min.js"></script>
  <script src="https://img.bc.haodanku.com/cms/flexible.js"></script>
  <style>
      body{font-family:"Microsoft YaHei",arial;background-color:#f2f2f2;max-width:750px;margin:0 auto!important;font-size:.32rem}
      ol,ul{list-style:none}
      li{list-style-type:none}
      .clearfix:after{display:block;overflow:hidden;clear:both;height:0;visibility:hidden;content:""}
      img{width:100%;display:block}
      *{margin:0;padding:0;-webkit-tap-highlight-color:transparent}
      .comHidden{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
      .comHidden1{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
      @media screen and (min-width:750px){.swiper-navbar::-webkit-scrollbar{width:0;height:0;background-color:#fafafa}
          .swiper-navbar::-webkit-scrollbar-thumb{border-radius:0;background-color:rgba(0,0,0,0)}
      }
      [v-cloak]{display:none}
      #app{min-height:100vh;position:relative}
      .title{position:fixed;top:0;left:0;width:100%;height:.8rem;background:#217346;display:flex;left:50%;max-width:750px;transform:translate(-50%,0)}
      .title li{color:#fff;font-size:.24rem;font-weight:700;display:flex;justify-content:center;align-items:center;text-align:center;position:relative;padding:0 .1rem;box-sizing:border-box}
      .title li::before{content:"";position:absolute;left:0;top:50%;width:1px;height:.34rem;background:#427e55;width:1px;margin-top:-.18rem}
      .shoplist li:nth-child(1),.title li:nth-child(1){width:17%;flex-shrink:0}
      .shoplist li:nth-child(5),.title li:nth-child(5){width:15%}
      .shoplist li:nth-child(3),.title li:nth-child(3){width:24%;flex-shrink:0}
      .shoplist li:nth-child(4),.title li:nth-child(4){width:16%;flex-shrink:0}
      .shoplist li:nth-child(2),.title li:nth-child(2){width:28%;flex-shrink:0}
      .title li:nth-child(1)::before{content:initial}
      .template2 .shoplist li:nth-child(1),.template2 .title li:nth-child(1){width:34.4%}
      .template2 .shoplist li:nth-child(2),.template2 .title li:nth-child(2){width:41.2%}
      .template2 .shoplist li:nth-child(3),.template2 .title li:nth-child(3){width:24.4%}
      .template3 .title li:nth-child(1):before,.template3 .title li:nth-child(2):before{content:inherit}
      .template3 .shoplist li:nth-child(1),.template3 .title li:nth-child(1){width:19%;border-right:none}
      .template3 .title li:nth-child(2){padding-left:.46rem}
      .template3 .shoplist li:nth-child(2),.template3 .title li:nth-child(2){width:32%;justify-content:end}
      .template3 .shoplist li:nth-child(3),.template3 .title li:nth-child(3){width:27%}
      .template3 .shoplist li:nth-child(4),.template3 .title li:nth-child(4){width:22%}
      .shoplist{display:flex;background-color:#f2f2f2}
      .shoplist li{color:#333;font-size:.22rem;display:flex;justify-content:center;align-items:center;text-align:center;border-right:1px solid #f8f8f8;padding:.2rem .1rem;box-sizing:border-box}
      .shoplist li:last-child{border-right:none}
      .shoplist:nth-last-child(2n){background-color:#fff}
      .shoplistbtn{width:1.1rem;height:.45rem;line-height:.45rem;background:#217346;border-radius:.06rem;font-size:.2rem;color:#fff;text-align:center;cursor:pointer}
      .shopPrice{font-size:.24rem;font-weight:700;color:#217346;font-style:normal}
      .shopPrice-em{font-style:normal;font-size:.2rem;color:#999;text-decoration:line-through}
      .red-packet{width:1.62rem}
      .gather-search{width:1.28rem;height:.83rem;background:#f6f6f6;box-shadow:0 .08rem .08rem 0 rgba(0,0,0,.1);opacity:.95;border-radius:.44rem 0 0 .44rem;display:flex;align-items:center;justify-content:center;border:.03rem solid #fff;border-right:0;margin-bottom:.12rem}
      .gather-search img{width:.665rem}
      .shop-Img>div{width:1rem;height:1rem;overflow:hidden}
      .shop-Img>div img{max-width:100%;max-height:100%}
      .inProduc-l-coupon{border-radius:.04rem;border:1px solid #217346;overflow:hidden;text-decoration:none}
      .inProduc-l-coupon span{background-color:#217346;color:#fff;padding:0 .04rem}
      .inProduc-l-coupon em{border:none;color:#217346;padding:0 .08rem;font-style:normal}
      .footer-swiper{position:fixed;width:100%;bottom:0;background-color:#f6f6f6;max-width:750px;height:1.4rem;-webkit-box-shadow:0 -2px 5px -2px rgba(0,0,0,.1)}
      .swiper-navbar{height:.7rem;overflow-x:auto;white-space:nowrap;width:6.8rem;margin:0 auto .2rem}
      .swiper-navbar ul{ -webkit-overflow-scrolling:touch}
      .swiper-next.active i,.swiper-prev.active i{background-image:url(http://img-haodanku-com.cdn.fudaiapp.com//FnxE9AM4zLRSHuqf2PxLIvw8e8Wk)}
      .swiper-wrap{width:100%;position:relative}
      .swiper-navbar li{width:2rem;color:#444;font-size:.24rem;cursor:pointer;border-right:1px solid #ededed;display:inline-block;text-align:center;flex-shrink:0;height:100%;box-sizing:border-box;align-items:center;display:inline-flex;justify-content:center;position:relative}
      .swiper-navbar li p.active{color:#217346;background-color:#fff}
      .swiper-navbar li p.active::after{position:absolute;content:"";bottom:0;left:0;width:100%;height:.04rem;background-color:#217346}
      .swiper-navbar li p{width:100%;height:100%;display:flex;justify-content:center;align-items:center;line-height:100%}
      .swiper-button-next0,.swiper-button-prev0{width:.35rem;background:#fff;top:0;margin:0;height:100%;left:0;display:flex;align-items:center;justify-content:center;border-right:1px solid #ededed;box-sizing:border-box}
      .swiper-button-next0{left:initial;right:0;border-left:none;border-left:1px solid #ededed}
      .swiper-button-next0 i,.swiper-button-prev0 i{background-image:url(http://img-haodanku-com.cdn.fudaiapp.com//FpVRyfVBr2Hf8h_M5DxpA-CUa5M-);width:.3rem;height:.3rem;display:block;background-size:100% 100%;transform:rotate(90deg);background-repeat:no-repeat}
      .swiper-button-prev0 i{transform:rotate(-90deg)}
      .swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:1}
      .swiper-button-next.swiper-button-disabled i,.swiper-button-prev.swiper-button-disabled i{background-image:url(http://img-haodanku-com.cdn.fudaiapp.com//FnxE9AM4zLRSHuqf2PxLIvw8e8Wk)}
      .combox{width:100%;-webkit-overflow-scrolling:touch}
      .gather-main .combox{top:.8rem}
      .realpic-loading{color:#999;font-size:.24rem;text-align:center;margin:2px 0}
      .vmIconLoad{width:.32rem;height:.32rem;font-size:20px;color:#4d74ff;display:inline-block;vertical-align:middle;background-image:url(http://img-haodanku-com.cdn.fudaiapp.com//Fs3CUOAV8FeUjyhyU-3xOO5DSphI);background-repeat:no-repeat;background-size:100% 100%;-webkit-animation:vmspinLoad 2s infinite linear;animation:vmspinLoad 1.2s infinite linear}
      .realpic-loading-new{position:fixed;top:50%;left:50%;margin-left:-.32rem;margin-top:-.32rem;z-index:9999999999}
      .realpic-loading-new .vmIconLoad{width:.64rem;height:.64rem;background-image:url(http://img-haodanku-com.cdn.fudaiapp.com//FqudiwU41h6RPRrC4qATMzygmp82)}
      .realpic-loading em{display:inline-block;vertical-align:middle;font-style:inherit}
      .vmIconLoad:before{ -webkit-font-smoothing:antialiased;transform:translate(0,0)}
      @keyframes vmspinLoad{from{transform:rotate(0)}
          50%{transform:rotate(180deg)}
          to{transform:rotate(360deg)}
      }
      @-webkit-keyframes vmspinLoad{from{transform:rotate(0)}
          50%{transform:rotate(180deg)}
          to{transform:rotate(360deg)}
      }
      .copyhide{opacity:0;position:absolute;top:0;left:0;z-index:-1000}
      .js-dust{display:none;position:fixed;top:50%;left:50%;width:7.5rem;height:9rem;transform:translate(-50%,-50%)}
      .js-dusts{display:none;position:fixed;top:50%;left:50%;width:7.5rem;height:9rem;transform:translate(-50%,-50%)}
      .js-dust-box{position:relative}
      .js-dust-box i{position:absolute;top:1.25rem;left:.82rem;width:5.6rem;height:6.78rem;cursor:pointer}
      .js-dusts .js-dust-box i{width:5.8rem;height:7.8rem}
      .Econtent-box span,.js-dust-box span,.shareBox span{position:absolute;bottom:-1rem;left:50%;margin-left:-.3rem;width:.6rem;height:.6rem;background:url(http://img-haodanku-com.cdn.fudaiapp.com//Fo2-nJ_43fsFStbAfqMUEcCFJnJ6);background-size:100% 100%;cursor:pointer}
      .swiper-next,.swiper-prev{position:absolute;top:0;height:.7rem;width:.35rem;background:#fff;top:0;display:flex;align-items:center;justify-content:center;border-right:1px solid #ededed;box-sizing:border-box}
      .swiper-prev i{transform:rotate(-90deg)}
      .swiper-next i,.swiper-prev i{background-image:url(http://img-haodanku-com.cdn.fudaiapp.com//FpVRyfVBr2Hf8h_M5DxpA-CUa5M-);width:.3rem;height:.3rem;display:block;background-size:100% 100%;transform:rotate(90deg);background-repeat:no-repeat}
      .swiper-prev i{transform:rotate(-90deg)}
      .swiper-next{left:initial;right:0;border-right:none;border-left:1px solid #ededed}
      .wrapMain{position:absolute;top:.8rem;bottom:1.4rem;width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
      .swiper-nav{width:95.4%;overflow:hidden;padding:0 .35rem;margin:0 auto}
      .Econtent{position:fixed;top:50%;left:50%;display:none;width:5.8rem;height:6.88rem;margin-left:-2.9rem;margin-top:-3.44rem;background:url(http://img.fqapps.com/258627940aca1f586048a2b314e2d19a) no-repeat;background-size:90% 90%;background-position:50% 50%}
      .Econtent-box{position:relative;padding-top:3.84rem}
      .taokolintext{text-align:center;color:#fff;height:.4rem}
      .btnBox{color:rgba(255,255,255,.4);text-align:center;font-size:.22rem;margin-top:.6rem}
      .Econtent-box span{bottom:-2rem}
      .share{bottom:3.5rem;width:1.28rem;height:.83rem;background:#f6f6f6;box-shadow:0 .08rem .08rem 0 rgba(0,0,0,.1);opacity:.95;border-radius:.44rem 0 0 .44rem;display:flex;align-items:center;justify-content:center;border:.03rem solid #fff;border-right:0}
      .share img{width:.665rem;margin-left:.25rem}
      .share i{margin-left:-.2rem;margin-top:-.5rem}
      .shareBox{display:none;position:fixed;top:50%;left:50%;width:5.2rem;transform:translate(-50%,-50%)}
      .shareBox img{width:100%;border-radius:.1rem}
      .shareBox span{bottom:-.8rem}
      .swiper-font{width:100%;font-size:.22rem;height:.5rem;line-height:.5rem;padding-left:10px;background:#217346;color:#fff;max-width:750px;margin:0 auto;z-index:123}
      .swiper-font .swiper-wrapper{transition-timing-function:linear}
      .wrap-fixed{position:fixed;right:0;top:50%;position:fixed;right:0;display:flex;flex-direction:column;align-items:flex-end}
  
  </style>
</head>


<template id="c-tmp-1">
  <div class="c-tmp-1">
    <div id="app" v-cloak>
      <ul class="title">
        <li>图片</li>
        <li>商品标题</li>
        <li>优惠信息</li>
        <li>到手价</li>
        <li>购买</li>
      </ul>
      <div v-if="oDusBool" class="wrapMain">
        <a href="javascript:" class="banner"><img v-bind:src="oDustToken.bannerImg1"></a>
        <!-- <a v-bind:href="oDustToken.kz_ad_links" v-else class="banner">
            <img v-bind:src="oDustToken.bannerImg2"></a> -->
        <!-- <a href="javascript:" class="banner"><img v-bind:src="oDustToken.bannerImg1"></a> -->
        <div>
          <div v-if="templateBool ==1">
            <div class="combox">
              <ul class="shoplist" v-for="(item,index) in shopArr">
                <li class="shop-Img">
                  <div class=" comflexCenter" v-if="item.itempic !=''">
                    <img v-bind:src="item.itempic">
                  </div>
                  <p v-else>无</p>
                </li>
                <li>
                  <p v-if="item.itemtitle !=''" class="comHidden1">{{item.itemtitle}}</p>
                  <p v-else>无</p>
                </li>
                <li>
                  <div v-if="item.couponmoney>0 || item.activity_gameplay !=''">
                    <p v-if="item.activity_gameplay !=''" class="comHidden1">{{item.activity_gameplay}}</p>
                  </div>
                  <p v-else>无</p>
                </li>
                <li>
                  <i v-if="item.itemendprice>=0"
                     class="shopPrice">￥{{parseFloat(item.itemendprice)}}<br><em
                    class="shopPrice-em">￥{{parseFloat(item.itemprice)}}</em></i><i v-else>-</i>
                </li>
                <li>
                  <p class="shoplistbtn" v-on:click="tokenBtn(index,item)" v-bind:id="'shop'+index">去抢购</p>
                </li>
              </ul>
              <p class="realpic-loading" v-if="loadshow && templateBool==1"><i
                class="vmIconLoad"></i><em>数据加载中...</em></p>
              <p class="realpic-loading" v-else>数据已经加载完了</p>
            </div>
          </div>
          <div class="template2" v-if="templateBool == 2">
            <ul class="title">
              <li>会场图</li>
              <li>会场名称</li>
              <li>购买</li>
            </ul>
            <div class="combox">
              <ul class="shoplist" v-for="(item,index) in shopArr">
                <li>
                  <div class=" comflexCenter" v-if="item.activity_img !=''">
                    <img v-bind:src="item.activity_img">
                  </div>
                  <p v-else>无</p>
                </li>
                <li>
                  <p v-if="item.activity_name !=''" class="comHidden1">{{item.activity_name}}</p>
                  <p v-else>无</p>
                </li>
                <li>
                  <p class="shoplistbtn" v-on:click="tokenBtn(index,item)" v-bind:id="'shop'+index">进入会场</p>
                </li>
              </ul>
              <p class="realpic-loading" v-if="loadshow && templateBool == 2"><i
                class="vmIconLoad"></i><em>数据加载中...</em></p>
              <p class="realpic-loading" v-else>数据已经加载完了</p>
            </div>
          </div>
          <div class=" template3" v-if="templateBool == 3">
            <ul class="title">
              <li></li>
              <li>店铺</li>
              <li>优惠信息</li>
              <li>进入店铺</li>
            </ul>
            <div class="combox">
              <ul class="shoplist" v-for="(item,index) in shopArr">
                <li>
                  <div class=" comflexCenter" v-if="item.shoplgo !=''" style="width: 1rem;height: 1rem;">
                    <img v-bind:src="item.shoplgo">
                  </div>
                  <p v-else>无</p>
                </li>
                <li>
                  <p class="comHidden1">{{item.shopname != "" ? item.shopname : "无"}}</p>
                </li>
                <li>
                  <p class="comHidden1">{{item.remark != "" ? item.remark : "无"}}</p>
                </li>
                <li>
                  <p class="shoplistbtn" v-on:click="tokenBtn(index,item)" v-bind:id="'shop'+index">进入店铺</p>
                </li>
              </ul>
              <p class="realpic-loading" v-if="loadshow && templateBool == 3"><i
                class="vmIconLoad"></i><em>数据加载中...</em></p>
              <p class="realpic-loading" v-else>数据已经加载完了</p>
            </div>
          </div>
        </div>
      
      </div>
      <p class="realpic-loading realpic-loading-new" v-if="dusLoad"><i class="vmIconLoad"></i><em></em></p>
      <div class="footer-swiper">
        <div class="swiper-wrap">
          <div class="swiper-container swiper-navbar">
            <ul class="swiper-wrapper">
              <li class="swiper-slide" v-for="(item,index) in navArr">
                <p v-on:click="navBtn(item)" v-bind:class="item.type == navType?'active':''">{{item.name}}</p>
              </li>
            </ul>
          </div>
          <div class="swiper-button-prev swiper-button-prev0"><i></i></div>
          <div class="swiper-button-next swiper-button-next0"><i></i></div>
        </div>
        <div class="swiper-container swiper-font swiper-no-swiping">
          <div class="swiper-wrapper">
            <div class="swiper-slide" v-for="(item,index) in plateArr">{{item.report}}</div>
          </div>
          <!-- Add Pagination -->
          <div class="swiper-pagination"></div>
        </div>
      </div>
      <div>
        <div class="js-dust" v-if="oDustToken.packetShow">
          <div class="js-dust-box">
            <img v-bind:src="oDustToken.big_packet">
            <i v-on:click="tokenBtn('123456789',oDustToken)" id="shop123456789"></i>
            <span v-on:click='layer.closeAll()'></span>
          </div>
        </div>
        <div class="js-dusts" v-if="oDustToken.kz_waimai_show && takeshareShut">
          <div class="js-dust-box">
            <img v-bind:src="oDustToken.kz_waimai_big_icon">
            <i v-on:click="tokenBtn('waimai',oDustToken)" id="shopwaimai"></i>
            <span v-on:click='layer.closeAll()'></span>
          </div>
        </div>
        
        <div class="Econtent">
          <div class="Econtent-box">
            <div class="taokolintext">{{Token}}</div>
            <div class="btnBox">手动长按复制口令</div>
            <span v-on:click='layer.closeAll()'></span>
          </div>
        </div>
        <div class="shareBox" v-if="oDustToken.shareShow">
          <img v-bind:src="oDustToken.poster">
          <p style="color: #fef1f1;text-align: center; font-size: 0.22rem; margin-top: 0.1rem;">长按保存图片分享</p>
          <span v-on:click='layer.closeAll()'></span>
        </div>
        <div class="wrap-fixed">
          
          <a v-bind:href="addSearch" class="gather-search" v-if="codeId !=''&&codeId !=undefined">
            <img src="http://img-haodanku-com.cdn.fudaiapp.com//FmkQ5Pvie1NIt6K-qT1hd6RAxoa4">
          </a>
          <div class="share" v-on:click="shareBtn()"
               v-if="shareShut && oDustToken.poster &&oDustToken.shareShow && scrollShow">
            <img src="http://img-haodanku-com.cdn.fudaiapp.com//FnrO3dSaobwhdtuZDDhnZS4sjrlF">
          </div>
          <div class="red-packet" v-if="takeiconShut && oDustToken.kz_waimai_show && scrollShow">
            <img v-bind:src="oDustToken.kz_waimai_little_icon" v-on:click="popupFun(0)">
          </div>
          <div class="red-packet" v-if="iconShut && oDustToken.packetShow && scrollShow">
            <img v-bind:src="oDustToken.little_packet" v-on:click="popupFun(1)">
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
var vmUrlSearchs = null;
var yid = "123456";//修改为自己的邀请码ID

function vmRequest(name) {
  if (!vmUrlSearchs) {
    vmUrlSearchs = new vmUrlSearch();
  }
  return vmUrlSearchs[name];
}

function vmUrlSearch() {
  var name, value;
  var str = location.href;
  var num = str.indexOf("?");
  str = str.substr(num + 1);
  var arr = str.split("&");
  for (var i = 0; i < arr.length; i++) {
    num = arr[i].indexOf("=");
    if (num > 0) {
      name = arr[i].substring(0, num);
      value = arr[i].substr(num + 1);
      this[name] = value;
    }
  }
}
if(vmRequest("yid")){
	yid = vmRequest("yid")
}
Vue.component("tmp-1", {
  template: "#c-tmp-1",
  data: function() {
    return {
      shopArr: [],
      loadmsg: true,
      loadshow: true,
      navArr: [],
      navType: "",
      templateBool: 1,// 1 为爆款清单 2会场 3免单
      Token: "",
      codeId: vmRequest("code"),

      oDustToken: {
        activity_id: "",
        activity_name: "",
        itemid: "",
        activity_url: "",
        poster: "", //分享图片
        bannerImg1: "",
        bannerImg2: "",
        packetShow: false,
        shareShow: false,
        little_packet: "", //小红包
        big_packet: "",  //大红包
        kz_ad_links: "", //清单页广告
        kz_waimai_activity_id: "",
        kz_waimai_activity_name: "",
        kz_waimai_big_icon: "",
        kz_waimai_little_icon: "",
        kz_waimai_show: false
      },

      oDusBool: false,
      oDustShowad: "",

      dusLoad: true,

      iconShut: true,
      shareShut: true,

      takeiconShut: true,
      takeshareShut: false,

      swiperPrev: true,
      swiperNext: false,

      plateArr: [],

      min_id: "1",
      scrollShow: true,  //滚动显示隐藏
      addSearch: location.pathname + "?tmp=search&code=" + vmRequest("code") + "&t=" + vmRequest("tmp"),
      vmHttp: window.location.protocol.substring(0, window.location.protocol.length - 1) == "https" ? window.location.protocol.substring(0, window.location.protocol.length - 1) : "http"
    };
  },
  mounted: function() {
    this.checkAdFun();

  },
  methods: {
    taobaoscroll: function() {  //滚动加载
      var self = this;
      var nScrollHight = 0;
      var nScrollTop = 0;
      var nDivHight = $(".wrapMain").height();
      $(".wrapMain").scroll(function() {

        nScrollHight = $(this)[0].scrollHeight;
        nScrollTop = $(this)[0].scrollTop;
        if(nScrollTop > 10) {
          self.scrollShow = false;
        } else {
          self.scrollShow = true;
        }
        if(parseInt(nScrollTop + nDivHight) + 10 >= nScrollHight) {
          if(self.loadmsg) {
            self.loadmsg = false;
            self.ajaxShop();
          }
        }
      });
    },
    ajaxShop: function() {
      var self = this;
      var url = "//v2.api.haodanku.com/activity_items";
      this.taobaoscroll();

      $.ajax({
        type: "GET",
        url: url,
        data: {
          cat_id: self.navType ,
          min_id: self.min_id,
          apikey: 'zqapi', //必填
        },
        dataType: "json",
        timeout: 5000,
        success: function(res) {
          self.min_id = res.min_id;
          var data = res.data || [];
          self.shopArr = self.shopArr.concat(data);
          if(data.length < 20) {
            self.loadmsg = false;
            self.loadshow = false;
          } else {
            self.loadmsg = true;
            self.loadshow = true;
          }
        },
        error: function() {
          self.loadmsg = false;
          self.loadshow = false;
        }
      });
    },
    templateState: function(item) {
        this.templateBool = item.module_type;
    },
    ajaxNav: function() {
      var self = this;
      $.ajax({
        type: "GET",
        url: "//v2.api.haodanku.com/activity_category",
        data: {
          apikey: 'zqapi', //必填
        },
        dataType: "json",
        timeout: 5000,
        success: function(res) {
          var list = (res.data || []);
          list.forEach(function(value) {
            value.type = value.id;
          });
          self.navArr = list;
          self.navType = list[0].type;
          self.templateState(list[0]);
          self.ajaxShop();
          self.$nextTick(function() {
            self.plateFun();
          });

          self.$nextTick(function() {
            var swiper1 = new Swiper(".swiper-navbar", {
              prevButton: ".swiper-button-prev0",
              nextButton: ".swiper-button-next0",
              slidesPerView: "auto",
              roundLengths: true,
              paginationClickable: true,
              spaceBetween: 0
            });
          });

        },
        error: function() {

        }

      });
    },
    navBtn: function(item) {
      var self = this;
      this.navType = item.type;
      this.shopArr = [];
      this.min_id = 1;
      this.loadmsg = false;
      this.loadshow = true;
      this.templateState(item);
      setTimeout(function() {
        self.ajaxShop();
      }, 30);

    },
    tokenBtn: function(oIndex, item) {
      // this.dusLoad = true;
      var self = this;
      var title = item.itemtitle;
      if(oIndex == "123456789") {
        title = item.itemtitle;
      }
      var id = item.activity_id;
      if(oIndex == "waimai") {
        title = item.kz_waimai_activity_name;
        id = item.kz_waimai_activity_id;
      }
      $.ajax({
        type: "Post",
        url: "https://tkf.ink/sourcecode_to_cid/",
        data: {
          yid: yid,
          activity_id: id,
          title: title,
          itemid: item.itemid,
          activity_url: item.activity_url,
          activityid: item.activityid,
          domain: window.location.host,
          shopurl: item.shopurl,
          shopid: item.shopid,
          cat_id: self.navType
        },
        dataType: "json",
        timeout: 5000,
        async: false,
        success: function(data) {
          self.dusLoad = false;
          if(data.code == "200") {
            self.Token = data.data;
          } else {
            self.Token = "";
            layer.msg(data.msg, {
              time: 2000,
              shade: 0.1,
              shadeClose: true
            });
          }
        },
        error: function() {
          self.Token = "";
          // self.dusLoad = false;
          layer.msg("网络错误，请检查网络重试", {
            time: 2000,
            shade: 0.1,
            shadeClose: true
          });
        }
      });
      self.copyBtn(oIndex);
    },
    copyBtn: function(oIndex) { //复制公共方法
      var self = this;
      var clipboard = new ClipboardJS("#shop" + oIndex, {
        text: function(target) {
          return self.Token;
        }
      });
      clipboard.on("success", function(e) {
        layer.msg("复制口令成功,请打开淘宝领取", {
          shade: 0.4,
          time: 2000,
          shadeClose: true
        }, function() {
          layer.closeAll();
        });
        // e.clearSelection();
        // clipboard.destroy();
      });
      clipboard.on("error", function(e) {
        layer.msg("复制口令失败！", {
          shade: 0.4,
          time: 1000,
          shadeClose: false
        }, function() {
          layer.open({
            type: 1,
            shift: 0,
            title: false,
            closeBtn: 0,
            shade: 0.4,
            shadeClose: true,
            content: $(".Econtent")
          });
        });

      });
    },

    checkAdFun: function() {
      var self = this;
      $.ajax({
        type: "Get",
        url: self.vmHttp + "://v2.api.haodanku.com/checkAd",
        data: {
          code: self.codeId
        },
        dataType: "json",
        timeout: 5000,
        success: function(data) {
          if(data.code == "200") {
            self.oDustToken = {
              activity_id: data.data.activity_id,
              itemtitle: data.data.activity_name,
              itemid: "",
              activity_url: "",
              poster: data.data.poster,
              bannerImg1: data.data.kz_banner,
              bannerImg2: data.data.kz_ad_banner,
              shareShow: data.data.kz_share_show == 1 ? true : false,
              packetShow: data.data.kz_packet_show == 1 ? true : false,
              little_packet: data.data.kz_little_packet,
              big_packet: data.data.kz_big_packet,
              kz_ad_links: data.data.kz_ad_links,

              kz_waimai_activity_id: data.data.kz_waimai_activity_id,
              kz_waimai_activity_name: data.data.kz_waimai_activity_name,
              kz_waimai_big_icon: data.data.kz_waimai_big_icon,
              kz_waimai_little_icon: data.data.kz_waimai_little_icon,
              kz_waimai_show: data.data.kz_waimai_show == 1 ? true : false
            };
            if(self.codeId != undefined && self.codeId != "") {
              self.oDustShowad = data.data.is_show_ad;
            } else {
              self.oDustShowad = 0;
            }
            self.ajaxNav();
            self.$nextTick(function() {
              if(self.oDustToken.packetShow) {
                self.popupFun(1);
              }
              self.oDusBool = true;
              self.dusLoad = false;

            });
          } else {
            layer.msg(data.message, {
              time: 2000,
              shade: 0.1,
              shadeClose: true
            });
          }
        },
        error: function() {
          layer.msg("网络错误，请检查网络重试", {
            time: 2000,
            shade: 0.1,
            shadeClose: true
          });
        }
      });
    },

    plateFun: function() {   //baogao
      var self = this;
      $.ajax({
        type: "Get",
        url: "https://www.haodanku.com/activity/activity_plate",
        data: {},
        dataType: "json",
        timeout: 5000,
        success: function(data) {
          if(data.code == "200") {
            self.plateArr = data.data;
            self.$nextTick(function() {
              var mySwiper2 = new Swiper(".swiper-font", {
                // direction: 'vertical', //向上
                autoplay: 1,
                speed: 8000, //速度
                loop: true, //自动轮播
                freeMode: true,
                slidesPerView: 1,
                autoplayDisableOnInteraction: false,
                // spaceBetween: 5,
                noSwiping: true,  //禁止用户操作要配合<div class="swiper-slide clearfix swiper-no-swiping">
                roundLengths: true
              });
            });

          }
        }
      });
    },
    popupFun: function(number) {
      if(number == 0) {
        this.takeshareShut = true;
        this.$nextTick(function() {
          layer.open({
            type: 1,
            shift: 0,
            title: false,
            closeBtn: 0,
            shade: 0.4,
            shadeClose: true,
            content: $(".js-dusts")
          });
        });
        return;
      }
      layer.open({
        type: 1,
        shift: 0,
        title: false,
        closeBtn: 0,
        shade: 0.4,
        shadeClose: true,
        content: $(".js-dust")
      });
    },
    shareBtn: function() {
      layer.open({
        type: 1,
        shift: 0,
        title: false,
        closeBtn: 0,
        shade: 0.4,
        shadeClose: true,
        content: $(".shareBox")
      });
    }
  }
});
</script>


<body>
<div id="vmgather">
  <tmp-1></tmp-1>
</div>
<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/Swiper/3.2.6/js/swiper.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/layer/2.3/layer.js"></script>
<script src="https://cdn.staticfile.org/clipboard.js/2.0.4/clipboard.min.js"></script>
<script>
var vmUrlSearchs = null;

function vmRequest(name) {
  if(!vmUrlSearchs) {
    vmUrlSearchs = new vmUrlSearch();
  }
  return vmUrlSearchs[name];
};

function vmUrlSearch() {
  var name, value;
  var str = location.href;
  var num = str.indexOf("?");
  str = str.substr(num + 1);
  var arr = str.split("&");
  for(var i = 0; i < arr.length; i++) {
    if(num = arr[i].indexOf("=") != -1) {
      num = arr[i].indexOf("=");
    } else {
      num = arr[i].indexOf("/");
    }
    if(num > 0) {
      name = arr[i].substring(0, num);
      value = arr[i].substr(num + 1);
      this[name] = value;
    }
  }
};
new Vue({
  el: "#vmgather"
});
</script>
</body>

</html>

